<template>
  <div class="search">
    <f-form ref="form" :action="api.order" :form-key="this.formItem.orderId" >
      <f-form-item label="订单编号"  name="orderNo" dataType="${formField.dataType}"   :value="formItem.orderNo" />
      <f-form-item label="下单人"  name="accountInfoId" dataType="${formField.dataType}"   :value="formItem.accountInfoId" />
      <f-form-item label="支付类型（PAY_WX微信  PAY_ALI支付宝 3线下PAY_UNDERLINE 4 PAY_BALANCE余额支付）"  name="payType" dataType="${formField.dataType}"   :value="formItem.payType" />
      <f-form-item label="订单状态（1待付款，2已付款,3已退款）"  name="orderStatus" dataType="number"   :value="formItem.orderStatus" />
      <f-form-item label=""  name="buySource" dataType="number"   :value="formItem.buySource" />
      <f-form-item label="用户备注"  name="remark" dataType="${formField.dataType}"   :value="formItem.remark" />
      <f-form-item label="订单总金额"  name="totalPrice" dataType="${formField.dataType}"   :value="formItem.totalPrice" />
      <f-form-item label="验证码"  name="orderCode" dataType="${formField.dataType}"   :value="formItem.orderCode" />
      <f-form-item label="如果支付方式为线下  是否确认（1已确认，2未确认）"  name="isCheck" dataType="number"   :value="formItem.isCheck" />
      <f-form-item label="推荐人Id同员工Id同accountId"  name="employeeId" dataType="${formField.dataType}"   :value="formItem.employeeId" />
      <f-form-item label="过期时间"  name="expireDate" dataType="${formField.dataType}"   :value="formItem.expireDate" />
      <f-form-item label="线下支付（销售人员收款验证时选择）"  name="paywayId" dataType="${formField.dataType}"   :value="formItem.paywayId" />
      <f-form-item label="支付时间"  name="payDate" dataType="${formField.dataType}"   :value="formItem.payDate" />
      <f-form-item label=""  name="airportId" dataType="${formField.dataType}"   :value="formItem.airportId" />
      <f-form-item label="支付参数"  name="payparamId" dataType="${formField.dataType}"   :value="formItem.payparamId" />
      <f-form-item label="支付入口"  name="payEntranceType" dataType="number"   :value="formItem.payEntranceType" />
      <f-form-item label=""  name="isEnd" dataType="number"   :value="formItem.isEnd" />
      <f-form-item label=""  name="refundRemark" dataType="${formField.dataType}"   :value="formItem.refundRemark" />
      <f-form-item label="是否处理"  name="isDeal" dataType="number"   :value="formItem.isDeal" />
      <f-form-item label="删除状态"  name="delState" dataType="number"   :value="formItem.delState" />
      <f-form-item label=""  name="weChatId" dataType="${formField.dataType}"   :value="formItem.weChatId" />
      <f-form-item label="易宝订单token,再次调取支付时用到"  name="yiBaoOrderToken" dataType="${formField.dataType}"   :value="formItem.yiBaoOrderToken" />
      <f-form-item label=""  name="yiBaoUniqueOrderNo" dataType="${formField.dataType}"   :value="formItem.yiBaoUniqueOrderNo" />
      <f-form-item label="电子签名Id"  name="accountElesignId" dataType="${formField.dataType}"   :value="formItem.accountElesignId" />
      <f-form-item label="订单来源"  name="sourceType" dataType="number"   :value="formItem.sourceType" />
      <f-form-item label="回调地址"  name="goodsCallbackUrl" dataType="${formField.dataType}"   :value="formItem.goodsCallbackUrl" />
      <f-form-item label="回调地址"  name="goodsStateCallbackUrl" dataType="${formField.dataType}"   :value="formItem.goodsStateCallbackUrl" />
      <f-form-item label=""  name="isCallbackSuccess1" dataType="number"   :value="formItem.isCallbackSuccess1" />
      <f-form-item label=""  name="isCallbackSuccess2" dataType="number"   :value="formItem.isCallbackSuccess2" />
      <f-form-item label="公司下单时用户的唯一标识"  name="thirdMemberId" dataType="${formField.dataType}"   :value="formItem.thirdMemberId" />
      <f-form-item label="生成物品的起始日期,计算有效期用"  name="flightDate" dataType="${formField.dataType}"   :value="formItem.flightDate" />
      <f-form-item label=""  name="createDate" dataType="${formField.dataType}"   :value="formItem.createDate" />
    </f-form>
  </div>
</template>
<script>
  import api from './js/api'
  export default {
    name: 'orderForm',
    props: {},
    data() {
      return {
        refs:this.$refs,
        api:  Object.assign(api, this.api),
        isAdd: true,//是否是添加模式
        loaded: false,//是否加载完成
        formItem: this.getFormItem()
      }
    },
    methods: {
      getFormItem() {
        return {
          orderId: '',
          orderNo: '',
          accountInfoId: '',
          payType: '',
          orderStatus: '',
          buySource: '',
          remark: '',
          totalPrice: '',
          orderCode: '',
          isCheck: '',
          employeeId: '',
          expireDate: '',
          paywayId: '',
          payDate: '',
          airportId: '',
          payparamId: '',
          payEntranceType: '',
          isEnd: '',
          refundRemark: '',
          isDeal: '',
          delState: '',
          weChatId: '',
          yiBaoOrderToken: '',
          yiBaoUniqueOrderNo: '',
          accountElesignId: '',
          sourceType: '',
          goodsCallbackUrl: '',
          goodsStateCallbackUrl: '',
          isCallbackSuccess1: '',
          isCallbackSuccess2: '',
          thirdMemberId: '',
          flightDate: '',
          createDate: ''
        }
      },
      //表单赋值
      setData(data) {
        this.$refs.form.resetFields()
        this.formItem = this.getFormItem()
        if (data && data.orderId) {
          let params={
              orderId:data.orderId
          }
          this.refs['form'].getDetails(params,(data)=>{
             this.formItem=data
             this.loaded = true
          })
          this.isAdd = false
        } else {
          this.loaded = true
        }
      },
      //提交表单
      handleSubmit(callback) {
        this.$refs.form.submit({  }, callback)
      }
    },
    created() {
    },
    components: {}
  }
</script>

<style scoped lang="less" rel="stylesheet/less">

</style>
